﻿<?php
	include '../inc/conn.php';
	
	session_start();	

	extract($_POST);
	extract($_GET);
	unset($_POST,$_GET);
	if (isset($act) && isset($id))
	{
		if ($act == "del"){
			
			$db = new mysql();
			$db->delete('eng_gmmaker', "docID=".$id);
			$db->close();
			echo "<script>alert('数据已成功删除!!!');window.location='admin_index.php?name=gmmaker';</script>";
		}
	}
?>
<div class="container-fluid">
<? if ($_SESSION['user'] != 1){  
	echo '<script>window.location="userinfo.php"</script>';
 } else {
?>
<div class="panel panel-primary">
    <div class="panel-heading">
        <h3 class="panel-title">管理面板>>母盘清单</h3>
    </div>
    <div class="panel-body">
	<div>
		<table border=0 cellpadding=0 class="table table-striped">
		<tr class="success"><th>电子编号</th><th>机种名</th><th>制作人</th><th>制作时间</th><th>操作</th></tr>
<?
		$db = new mysql();
		$db->query("select * from eng_gmmaker order by docID desc");
		$num = $db->db_num_rows();
		for($i=0; $i<$num; $i++){
			$row = $db->fetch_assoc();
			$item = $i + 1;
			echo "			<tr>";
			echo "<td><a href='#' onclick=\"javascript:window.open('mod_gmmaker.php?docid=${row['docID']}','修改母盘项目', 'height=800, width=1000, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no');\">${row['docID']}</a></td>";
			echo "<td>".htmlspecialchars_decode($row['SKU'])."</td>";
			echo "<td>${row['Owner']}</td>";
			echo "<td>${row['add_date']}</td>";
			echo "<td>";
			if (isset($_SESSION['admin']))
				echo "<a href='admin_gmmaker.php?id=${row['docID']}&act=del' rel='tooltip' title='删除表内容，当心哦~~~'><font color='red'><span class=\"glyphicon glyphicon-remove\"></span></font></a></td>";
			echo "</tr>\n";
		}
?>
		</table>
	</div>
</div>
</div>
</div>
<? 
}
	$db->close();
?>
